package ch.bfh.java.directorysynchronizer.presentation.items;

import java.awt.Dimension;
import java.awt.Point;
import java.io.File;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.Timer;

import ch.bfh.java.directorysynchronizer.business.DirectorySynchronizer;
import ch.bfh.java.directorysynchronizer.presentation.Frame.MainFrame;

public class Workbench
{

	private int mainFrameWidth, mainFrameHeight, chooseDirectoryPanelHeight,
	        startStopPanelHeight, logfilePanleHeigth, 
	        subPanelHeight, titlePanelHeight, countOfFiles,
	        numberOfCurrentFile;

	private Point mainFramePosition;

	private Dimension chooseDirectoryDimension, startStopPanelDimension,
	        logfilePaneldimension, 
	        subPanelDimension, titelPanelDimension;

	private JLabel subtext, titel;

	private JTextArea logfileDisplayer;

	private JTextField sourceDirectoryTextfield, targetDirectoryTextfield,
	        logfileDirectoryTextfield;

	private JButton startSynchronizingButton, stopSynchronizingButton;

	private File sourceDirectoryFile, targetDirectoryFile,
	        logfileDirectoryFile;

	private String logfilename;
	
	private Timer timer;
	
	private DirectorySynchronizer synchronizer;

	private MainFrame mainFrame;

	public Workbench()
	{

		this.mainFramePosition = new Point(400, 100);

		// panelgr�ssen
		this.mainFrameWidth = 800;
		this.chooseDirectoryPanelHeight = 150;
		this.startStopPanelHeight = 50;
		this.subPanelHeight = 50;
		this.titlePanelHeight = 80;
		this.logfilePanleHeigth = 200;

		this.mainFrameHeight = (titlePanelHeight + chooseDirectoryPanelHeight
		        + startStopPanelHeight
		        + subPanelHeight + logfilePanleHeigth) + 50;

		// Paneldimensionen
		this.chooseDirectoryDimension = new Dimension(mainFrameWidth,
		        chooseDirectoryPanelHeight);
		this.startStopPanelDimension = new Dimension(mainFrameWidth,
		        startStopPanelHeight);
		this.logfilePaneldimension = new Dimension(mainFrameWidth - 100,
		        logfilePanleHeigth);;
		this.subPanelDimension = new Dimension(mainFrameWidth, subPanelHeight);
		this.titelPanelDimension = new Dimension(mainFrameWidth,
		        titlePanelHeight);

		// items
		this.subtext = new JLabel();
		this.titel = new JLabel();

		this.sourceDirectoryTextfield = new JTextField();
		this.targetDirectoryTextfield = new JTextField();
		this.logfileDirectoryTextfield = new JTextField();

		this.logfileDisplayer = new JTextArea();

		this.startSynchronizingButton = new JButton();
		this.stopSynchronizingButton = new JButton();

		this.numberOfCurrentFile = 0;
		

	}

	/*
	 * Getters and Setters for all
	 */
	public int getMainframewidth()
	{
		return mainFrameWidth;
	}

	public void setMainframewidth(int mainframewidth)
	{
		this.mainFrameWidth = mainframewidth;
	}

	public int getMainframeheight()
	{
		return mainFrameHeight;
	}

	public void setMainframeheight(int mainframeheight)
	{
		this.mainFrameHeight = mainframeheight;
	}

	public Point getMainframeposition()
	{
		return mainFramePosition;
	}

	public void setMainframeposition(Point mainframeposition)
	{
		this.mainFramePosition = mainframeposition;
	}

	public Dimension getChooseDirectoryDimension()
	{
		return chooseDirectoryDimension;
	}

	public void setChooseDirectoryDimension(Dimension chooseDirectoryDimension)
	{
		this.chooseDirectoryDimension = chooseDirectoryDimension;
	}

	public Dimension getStartStopPanelDimension()
	{
		return startStopPanelDimension;
	}

	public void setStartStopPanelDimension(Dimension startStopPanelDimension)
	{
		this.startStopPanelDimension = startStopPanelDimension;
	}

	public int getChooseDirectoryPanelHeight()
	{
		return chooseDirectoryPanelHeight;
	}

	public void setChooseDirectoryPanelHeight(int chooseDirectoryPanelHeight)
	{
		this.chooseDirectoryPanelHeight = chooseDirectoryPanelHeight;
	}

	public int getStartStopPanelHeight()
	{
		return startStopPanelHeight;
	}

	public void setStartStopPanelHeight(int startStopPanelHeight)
	{
		this.startStopPanelHeight = startStopPanelHeight;
	}

	public int getLogfilePanleHeigth()
	{
		return logfilePanleHeigth;
	}

	public void setLogfilePanleHeigth(int logfilePanleHeigth)
	{
		this.logfilePanleHeigth = logfilePanleHeigth;
	}

	public Dimension getLogfilePanelDimension()
	{
		return logfilePaneldimension;
	}

	public void setLogfilePaneldimension(Dimension logfilePaneldimension)
	{
		this.logfilePaneldimension = logfilePaneldimension;
	}

	public int getSubPanelHeight()
	{
		return subPanelHeight;
	}

	public void setSubPanelHeight(int subPanelHeight)
	{
		this.subPanelHeight = subPanelHeight;
	}

	public int getTitlePanelHeight()
	{
		return titlePanelHeight;
	}

	public void setTitlePanelHeight(int titlePanelHeight)
	{
		this.titlePanelHeight = titlePanelHeight;
	}

	public Dimension getSubPanelDimension()
	{
		return subPanelDimension;
	}

	public void setSubPanelDimension(Dimension subPanelDimension)
	{
		this.subPanelDimension = subPanelDimension;
	}

	public Dimension getTitelPanelDimension()
	{
		return titelPanelDimension;
	}

	public void setTitelPanelDimension(Dimension titelPanelDimension)
	{
		this.titelPanelDimension = titelPanelDimension;
	}

	public JTextArea getLogfileDisplayer()
	{
		return logfileDisplayer;
	}

	public void setLogfileDisplayer(JTextArea logfileDisplayer)
	{
		this.logfileDisplayer = logfileDisplayer;
	}

	public JLabel getSubtext()
	{
		return subtext;
	}

	public void setSubtext(JLabel subtext)
	{
		this.subtext = subtext;
	}

	public JLabel getTitel()
	{
		return titel;
	}

	public void setTitel(JLabel titel)
	{
		this.titel = titel;
	}

	public JTextField getSourceDirectoryTextfield()
	{
		return sourceDirectoryTextfield;
	}

	public void setSourceDirectoryTextfield(JTextField sourceDirectoryTextfield)
	{
		this.sourceDirectoryTextfield = sourceDirectoryTextfield;
	}

	public JTextField getTargetDirectoryTextfield()
	{
		return targetDirectoryTextfield;
	}

	public void setTargetDirectoryTextfield(JTextField targetDirectoryTextfield)
	{
		this.targetDirectoryTextfield = targetDirectoryTextfield;
	}

	public JTextField getLogfileDirectoryTextfield()
	{
		return logfileDirectoryTextfield;
	}

	public void setLogfileDirectoryTextfield(
	        JTextField logfileDirectoryTextfield)
	{
		this.logfileDirectoryTextfield = logfileDirectoryTextfield;
	}

	public JButton getStartSynchronizingButton()
	{
		return startSynchronizingButton;
	}

	public void setStartSynchronizingButton(JButton startSynchronizingButton)
	{
		this.startSynchronizingButton = startSynchronizingButton;
	}

	public JButton getStopSynchronizingButton()
	{
		return stopSynchronizingButton;
	}

	public void setStopSynchronizingButton(JButton stopSynchronizingButton)
	{
		this.stopSynchronizingButton = stopSynchronizingButton;
	}

	public File getSourceDirectoryFile()
	{
		return sourceDirectoryFile;
	}

	public void setSourceDirectoryFile(File sourceDirectoryFile)
	{
		this.sourceDirectoryFile = sourceDirectoryFile;
	}

	public File getTargetDirectoryFile()
	{
		return targetDirectoryFile;
	}

	public void setTargetDirectoryFile(File targetDirectoryFile)
	{
		this.targetDirectoryFile = targetDirectoryFile;
	}

	public File getLogfileDirectoryFile()
	{
		return logfileDirectoryFile;
	}

	public void setLogfileDirectoryFile(File logfileDirectoryFile)
	{
		this.logfileDirectoryFile = logfileDirectoryFile;
	}

	public String getLogfilename()
	{
		return logfilename;
	}

	public void setLogfilename(String logfilename)
	{
		this.logfilename = logfilename;
	}

	public int getCountOfFiles()
	{
		return countOfFiles;
	}

	public void setCountOfFiles(int countOfFiles)
	{
		this.countOfFiles = countOfFiles;
	}

	public int getNumberOfcurrentFile()
	{
		return numberOfCurrentFile;
	}

	public void setNumberOfcurrentFile(int numberOfcurrentFile)
	{
		this.numberOfCurrentFile = numberOfcurrentFile;
	}

	public Timer getTimer()
    {
    	return timer;
    }

	public void setTimer(Timer timer)
    {
    	this.timer = timer;
    }

	public DirectorySynchronizer getSynchronizer()
    {
    	return synchronizer;
    }

	public void setSynchronizer(DirectorySynchronizer synchronizer)
    {
    	this.synchronizer = synchronizer;
    }

	public void setMainFrame(MainFrame mainFrame)
    {
	    this.mainFrame = mainFrame;	    
    }

	public MainFrame getMainFrame()
	{
		return mainFrame;
	}
	
}
